import * as turf from "@turf/turf";

import AttackArrow from "./AttackArrow";
import DoubleArrow from "./DoubleArrow";
import FineArrow from "./FineArrow";
import GatheringPlace from "./GatheringPlace";
import StraightArrow from "./StraightArrow";
import ThreeArrow from "./ThreeArrow";

export {
	AttackArrow,
	DoubleArrow,
	ThreeArrow,
	StraightArrow,
	FineArrow,
	GatheringPlace,
};

export const GenerateDict = {
	// draw_rectangle: DrawRectangle,
	// draw_icon: DrawIcon,
	// draw_text: DrawText,
	// draw_circle: DrawCircle,
	// draw_ellipse: DrawEllipse,
	draw_attack_arrow: AttackArrow.generate.bind(AttackArrow),
	draw_double_arrow: DoubleArrow.generate.bind(DoubleArrow),
	draw_three_arrow: ThreeArrow.generate.bind(ThreeArrow),
	draw_straight_arrow: StraightArrow.generate.bind(StraightArrow),
	draw_fine_arrow: FineArrow.generate.bind(FineArrow),
	draw_gathering_place: GatheringPlace.generate.bind(GatheringPlace),
};

export const toLineGeojson = (coords, properties) => {
	const geojson = turf.lineString(coords, properties);

	return geojson;
};
